<template>
  <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig" :paramsObj="{isWithAuth:props.isWithAuth}">
    <template v-slot:ArchivesDialog="{ row, show }">
      <Archives :api="baseConfig.api" :key="show" :nowRowData="row"></Archives>
    </template>
  </aplid-base-crud>
</template>

<script setup lang="ts">
type Props = {
  isWithAuth?:any
}
let props = withDefaults(defineProps<Props>(),{
  isWithAuth:undefined
})
import Archives from '@/views/datacenter/business/familyBedConstruct/components/Archives/index.vue'

const stateDicData = [
  { label: '未完成', value: '0', type: 'danger' },
  { label: '进行中', value: '1', type: 'info' },
  { label: '已完成', value: '2', type: 'success' },
]

const baseConfig = {
  pageName: '家庭养老床位建设档案',
  dictcodes: ['APPROVAL_STSTUS', 'LEVEL', 'ELDERLY_TYPE', 'ECONOMIC_SITUATION', 'COMMON_FLAG', 'ELDERLY_RELATIONSHIP', 'RESULT'],
  rowKey: 'id',
  api: {
    index: 'dpFamilyConstructionArchives_page',
  },
  auth: {
    index: 'view_dpFamilyConstructionArchives_page',
  },
  menuBtn: [
    {
      icon: 'editor',
      label: '查看档案',
      type: 'primary',
      operate: 'Archives',
      auth: 'view_dpFamilyConstructionArchives_page',
      text: true,
      show: true,
    },
  ],
  tableConfig: {
    stripe: true,
    border: false,
    tableLayout: 'auto',
    columns: [
      { label: '所属区', prop: 'crAreaName' },
      { label: '提升行动', prop: 'promoteActionLabel' },
      {
        label: '申请档案',
        prop: 'applyState',
        custome: 'tag',
        dicData: stateDicData,
      },
      {
        label: '评估档案',
        prop: 'assessState',
        custome: 'tag',
        dicData: stateDicData,
      },
      {
        label: '签约档案',
        prop: 'signState',
        custome: 'tag',
        dicData: stateDicData,
      },
      {
        label: '改造档案',
        prop: 'remouldState',
        custome: 'tag',
        dicData: stateDicData,
      },
      {
        label: '验收档案',
        prop: 'acceptanceState',
        custome: 'tag',
        dicData: stateDicData,
      },
      {
        label: '操作',
        prop: 'menu',
        width: 200,
        fixed: 'right',
      },
    ],
  },
}
</script>

<style scoped></style>
